package com.southminority.ethnic.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 新闻公告实体类
 * 
 * @author SouthMinority
 */
@Data
@TableName("news")
@Schema(description = "新闻公告")
public class News implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "新闻ID")
    private Long id;

    /**
     * 标题
     */
    @TableField("title")
    @Schema(description = "标题")
    private String title;

    /**
     * 内容
     */
    @TableField("content")
    @Schema(description = "内容")
    private String content;

    /**
     * 摘要
     */
    @TableField("summary")
    @Schema(description = "摘要")
    private String summary;

    /**
     * 封面图片
     */
    @TableField("cover_image")
    @Schema(description = "封面图片")
    private String coverImage;

    /**
     * 外部链接URL
     */
    @TableField("external_url")
    @Schema(description = "外部链接URL")
    private String externalUrl;

    /**
     * 作者ID
     */
    @TableField("author_id")
    @Schema(description = "作者ID")
    private Long authorId;

    /**
     * 作者姓名
     */
    @TableField("author_name")
    @Schema(description = "作者姓名")
    private String authorName;

    /**
     * 归属机构ID
     */
    @TableField("organization_id")
    @Schema(description = "归属机构ID")
    private Long organizationId;

    /**
     * 分类
     */
    @TableField("category")
    @Schema(description = "分类")
    private String category;

    /**
     * 标签
     */
    @TableField("tags")
    @Schema(description = "标签")
    private String tags;

    /**
     * 浏览次数
     */
    @TableField("view_count")
    @Schema(description = "浏览次数")
    private Integer viewCount;

    /**
     * 是否置顶：1-是，0-否
     */
    @TableField("is_top")
    @Schema(description = "是否置顶：1-是，0-否")
    private Integer isTop;

    /**
     * 发布时间
     */
    @TableField("publish_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "发布时间")
    private LocalDateTime publishTime;

    /**
     * 状态：1-已发布，0-草稿，-1-已删除
     */
    @TableField("status")
    @Schema(description = "状态：1-已发布，0-草稿，-1-已删除")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;
} 
